﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WinFormsCrawler
{
    public class LogInfo
    {
        LogInfo()
        {
        }

        static LogInfo _Instance = new LogInfo();
        public static LogInfo Instance { get => _Instance; }

        public ListBox _listBox = null;

        public void Log(string info)
        {
            _listBox.Invoke(new Action(() => {
                string str = string.Format("{0}\t{1}", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), info);
                _listBox.Items.Add(str);
            }));
        }
    }
}
